import { DeptDto, DeptVo } from "@/types/modules/system";
import axios from "axios";

const contentPath = '/system/dept'

export function create(dept: DeptDto) {
  return axios.post<boolean>(`${contentPath}`, dept)
}

export function update(dept: DeptDto) {
  return axios.put<boolean>(`${contentPath}`, dept)
}

export function deleteById(id: number) {
  return axios.delete<boolean>(`${contentPath}/${id}`)
}

export function findById(id: number) {
  return axios.get<DeptVo>(`${contentPath}/${id}`)
}

export function listTree() {
  return axios.get(`${contentPath}/tree`)
}
